/**
 * Created by 1 on 2017/1/3.
 */
(function(){
    "use strict";
    var levelArr=(function(){
        var arr=[];
        for(var i=0;i<10;i++){
            arr.push(Math.pow(2,i)*10000);
        }
        return arr;
    })();
    function Level(){
        this.level=1;
        this.canvas=new Canvas("level",100,70);
        this._init();
    }
    Level.prototype={
        constructor:Level,
        _init:function(){
            this._render();
        },
        _render:function(){
            this.canvas.drawText(this.level);
        },
        checkLevel:function(score){
           if(score>levelArr[this.level-1]){
               this.level++;
               this._render();
               return this.level;
           }

        }
    };
    window.Level=Level;
})();